<html><head><title>Ribbon.pb</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<pre><font face="Courier New, Courier, mono"size="2"><font color="#3A3966">;
</font><font color="#3A3966">; ------------------------------------------------------------
</font><font color="#3A3966">;
</font><font color="#3A3966">;   PureBasic - Ribbon
</font><font color="#3A3966">;
</font><font color="#3A3966">;    (c) Fantaisie Software
</font><font color="#3A3966">;
</font><font color="#3A3966">; ------------------------------------------------------------
</font><font color="#3A3966">;

</font><b><font color="#3A3966">IncludeFile</font></b> <font color="#924B72">#PB_Compiler_Home</font> + &quot;examples/3d/Screen3DRequester.pb&quot;

<b><font color="#3A3966">Define</font></b> yaw.f, X.f, Y.f, Z.f, FOV.f, Timer.i

<b><font color="#3A3966">If</font></b> <font color="#3A3966">InitEngine3D</font>()
  
<font color="#3A3966">  Add3DArchive</font>(<font color="#924B72">#PB_Compiler_Home</font> + &quot;examples/3d/Data/Textures&quot;, <font color="#924B72">#PB_3DArchive_FileSystem</font>)
<font color="#3A3966">  Add3DArchive</font>(<font color="#924B72">#PB_Compiler_Home</font> + &quot;examples/3d/Data/Scripts&quot;, <font color="#924B72">#PB_3DArchive_FileSystem</font>)
<font color="#3A3966">  Add3DArchive</font>(<font color="#924B72">#PB_Compiler_Home</font> + &quot;examples/3d/Data/Packs/desert.zip&quot;, <font color="#924B72">#PB_3DArchive_Zip</font>)
<font color="#3A3966">  Parse3DScripts</font>()
  
<font color="#3A3966">  InitSprite</font>()
<font color="#3A3966">  InitKeyboard</font>()
<font color="#3A3966">  InitMouse</font>()
  <b><font color="#3A3966">If</font></b> <font color="#3A3966">Screen3DRequester</font>()
    
    <font color="#3A3966">; Ground
</font>    <font color="#3A3966">;
</font><font color="#3A3966">    GetScriptMaterial</font>(0, &quot;Scene/GroundBlend&quot;)
<font color="#3A3966">    CreatePlane</font>(0, 10000, 10000, 100, 100, 50, 50)
<font color="#3A3966">    CreateEntity</font>(0,<font color="#3A3966"> MeshID</font>(0),<font color="#3A3966"> MaterialID</font>(0))
    
    <font color="#3A3966">; Node for Ribbon and Billboard
</font>    <font color="#3A3966">;
</font><font color="#3A3966">    CreateNode</font>(0, 0, 500, 0)
    
    <font color="#3A3966">;Ribbon
</font>    <font color="#3A3966">;
</font><font color="#3A3966">    GetScriptMaterial</font>(1, &quot;Scene/RibbonTrail&quot;)
<font color="#3A3966">    CreateRibbonEffect</font>(0,<font color="#3A3966"> MaterialID</font>(1), 1, 80, 1750)
<font color="#3A3966">    RibbonEffectColor</font>(0, 0,<font color="#3A3966"> RGBA</font>(255, 255, 255, 255),<font color="#3A3966"> RGBA</font>(0, 0, 255, 255))
<font color="#3A3966">    RibbonEffectWidth</font>(0, 0, 50, 3)
<font color="#3A3966">    AttachRibbonEffect</font>(0,<font color="#3A3966"> NodeID</font>(0))
    
    <font color="#3A3966">; Billboard
</font>    <font color="#3A3966">;
</font><font color="#3A3966">    GetScriptMaterial</font>(2, &quot;Scene/burst&quot;)
<font color="#3A3966">    CreateBillboardGroup</font>(0,<font color="#3A3966"> MaterialID</font>(2), 512, 512)
<font color="#3A3966">    AddBillboard</font>(0, 0, 0, 0)
        
<font color="#3A3966">    AttachNodeObject</font>(0,<font color="#3A3966"> BillboardGroupID</font>(bGrp))
   
    <font color="#3A3966">; Camera
</font>    <font color="#3A3966">;
</font><font color="#3A3966">    CreateCamera</font>(0, 0, 0, 100, 100)
<font color="#3A3966">    MoveCamera</font>(0, 2000, 100, 2000, <font color="#924B72">#PB_Absolute</font>)
<font color="#3A3966">    CameraLookAt</font>(0, 0, 1500, 0)
<font color="#3A3966">    CameraFOV</font>(0, 60)
    
    <font color="#3A3966">; Skybox
</font>    <font color="#3A3966">;
</font><font color="#3A3966">    SkyBox</font>(&quot;desert07.jpg&quot;)
        
    <b><font color="#3A3966">Repeat</font></b>
<font color="#3A3966">      Screen3DEvents</font>()
      
      <b><font color="#3A3966">If</font></b> Timer &lt;<font color="#3A3966"> ElapsedMilliseconds</font>()
        Timer =<font color="#3A3966"> ElapsedMilliseconds</font>() + 5
        yaw + 0.1
      <b><font color="#3A3966">EndIf</font></b> 
               
      <font color="#3A3966">;Ribbon
</font>      X = 1000 + 500 *<font color="#3A3966"> Cos</font>(<font color="#3A3966">ElapsedMilliseconds</font>() / 250)
      Y = 1500 + 750 *<font color="#3A3966"> Cos</font>(<font color="#3A3966">ElapsedMilliseconds</font>() / 350)
      Z = 500  + 250 *<font color="#3A3966"> Cos</font>(<font color="#3A3966">ElapsedMilliseconds</font>() / 750)
<font color="#3A3966">      MoveNode</font>(0, X, Y, Z, <font color="#924B72">#PB_Absolute</font>)
      
      <font color="#3A3966">;Camera
</font>      FOV = 60 - 30 *<font color="#3A3966"> Cos</font>(<font color="#3A3966">ElapsedMilliseconds</font>() / 2500)
<font color="#3A3966">      RotateCamera</font>(0, 0, yaw, 0)
<font color="#3A3966">      CameraFOV</font>(0, FOV)
<font color="#3A3966">      CameraLookAt</font>(0, X, Y, Z)
         
      
<font color="#3A3966">      RenderWorld</font>()
<font color="#3A3966">      Screen3DStats</font>()
<font color="#3A3966">      FlipBuffers</font>()
      
    <b><font color="#3A3966">Until</font></b> <font color="#3A3966">KeyboardPushed</font>(<font color="#924B72">#PB_Key_Escape</font>) <b><font color="#3A3966">Or</font></b> Quit = 1
    
  <b><font color="#3A3966">EndIf</font></b>
  
<b><font color="#3A3966">Else</font></b>
<font color="#3A3966">  MessageRequester</font>(&quot;Error&quot;, &quot;The 3D Engine can't be initialized&quot;, 0)
<b><font color="#3A3966">EndIf</font></b>

<b><font color="#3A3966">End</font></b></font></pre>
</body></html>
